<template>
  <div class="app-container">
    <list-page-container>
      <template slot="table">
        <el-table @sort-change="handleSortChange" height="100%" v-loading="loading" :data="dataList">
          <el-table-column label="保单号" align="center" prop="policyNumber"/>
          <el-table-column label="所属人" align="center" prop="name"/>
          <el-table-column label="身份证号" align="center" prop="idCard"/>
          <el-table-column label="地块序号" align="center" prop="plotNumber"/>
          <el-table-column label="损失面积" align="center" prop="lossArea"/>
          <el-table-column label="地块序号" align="center" prop="degreeOfLoss"/>
          <el-table-column label="损失程度" align="center" prop="plotNumber"/>
          <el-table-column width="400" label="操作" align="center" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-edit"
                  @click="showGeometry(scope.row)"
              >查看位置
              </el-button>
<!--              <el-button-->
<!--                  size="mini"-->
<!--                  type="text"-->
<!--                  icon="el-icon-edit"-->
<!--                  @click="showPhoto(scope.row)"-->
<!--              >查看照片-->
<!--              </el-button>-->
            </template>
          </el-table-column>
        </el-table>
      </template>

      <template slot="pageDisplay">
        <pagination
            v-show="total>0"
            :total="total"
            :page.sync="tableQueryParams.pageNum"
            :limit.sync="tableQueryParams.pageSize"
            @pagination="getList"
        />
      </template>
    </list-page-container>

    <el-dialog title="照片" :visible.sync="open" width="800px" append-to-body>
      <el-image
          style="width: 500px; height: 500px"
          :src="url"></el-image>
    </el-dialog>
  </div>

</template>

<script>
import {listPageMixins} from "@/mixins/listPageMixins";
import ShowFileList from "@/components/ShowFileList/index.vue";
import {getFileArchive, getOrderBaseDetailByNo, queryBidCheckingList} from "@/api/bidChecking";

export default {
  name: 'noticeAnnouncement',
  mixins: [listPageMixins],
  components: {
    ShowFileList,
  },
  data() {
    return {
      url: '',
      open: false,
      modelName: '现场验标',
      // 查询参数
      queryParams: {},
      otherQueryParam: {},
      getListFun: queryBidCheckingList,
    }
  },
  methods: {
    showGeometry(row) {
      getOrderBaseDetailByNo({tbdh: row.policyNumber}).then(res => {
        if (res?.data?.id == null || res?.data?.id === '') {
          this.$message.error('暂无保单数据')
          return
        }
        this.$router.push({path: '/chit/chitLook', query: {chitId: res?.data?.id}})
      });
    },
    showPhoto(row) {
      getFileArchive(row.photo).then(res => {
        this.url = res.data.fileUrl
        this.open = true
      })
    }
  }
}
</script>

<style scoped>

</style>
